package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PhoneAndCodeMapper;
import com.ruoyi.system.domain.PhoneAndCode;
import com.ruoyi.system.service.IPhoneAndCodeService;

/**
 * 手机号验证码Service业务层处理
 *
 * @author ruoyi
 * @date 2025-06-20
 */
@Service
public class PhoneAndCodeServiceImpl implements IPhoneAndCodeService {
    @Autowired
    private PhoneAndCodeMapper phoneAndCodeMapper;

    /**
     * 查询手机号验证码
     *
     * @param id 手机号验证码主键
     * @return 手机号验证码
     */
    @Override
    public PhoneAndCode selectPhoneAndCodeById(Long id) {
        return phoneAndCodeMapper.selectPhoneAndCodeById(id);
    }

    /**
     * 查询手机号验证码列表
     *
     * @param phoneAndCode 手机号验证码
     * @return 手机号验证码
     */
    @Override
    public List<PhoneAndCode> selectPhoneAndCodeList(PhoneAndCode phoneAndCode) {
        return phoneAndCodeMapper.selectPhoneAndCodeList(phoneAndCode);
    }

    /**
     * 新增手机号验证码
     *
     * @param phoneAndCode 手机号验证码
     * @return 结果
     */
    @Override
    public int insertPhoneAndCode(PhoneAndCode phoneAndCode) {
            return phoneAndCodeMapper.insertPhoneAndCode(phoneAndCode);
    }

    /**
     * 修改手机号验证码
     *
     * @param phoneAndCode 手机号验证码
     * @return 结果
     */
    @Override
    public int updatePhoneAndCode(PhoneAndCode phoneAndCode) {
        return phoneAndCodeMapper.updatePhoneAndCode(phoneAndCode);
    }

    /**
     * 批量删除手机号验证码
     *
     * @param ids 需要删除的手机号验证码主键
     * @return 结果
     */
    @Override
    public int deletePhoneAndCodeByIds(Long[] ids) {
        return phoneAndCodeMapper.deletePhoneAndCodeByIds(ids);
    }

    /**
     * 删除手机号验证码信息
     *
     * @param id 手机号验证码主键
     * @return 结果
     */
    @Override
    public int deletePhoneAndCodeById(Long id) {
        return phoneAndCodeMapper.deletePhoneAndCodeById(id);
    }
}
